package com.ck.transaction.service;

import com.ck.common.entity.SysUser;
import com.ck.transaction.controller.SpringTransactionDemoService;
import com.ck.transaction.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class SpringTransactionDemoService2 {
    @Autowired
    private SysUserMapper sysUserMapper;

    @Transactional
    public void addSysUserEntityToDB10(){
        SysUser user = SpringTransactionDemoService.getSysUserEntity(10);
        sysUserMapper.insert(user);
        int i = 1/0;
    }
}
